﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Laba1
{
    public class Achivement: IPrintable
    {
        private DateTime _date;
        private int _rating;
        private Task _task;

        private Achivement(DateTime date, int rating, Task task)
        {
            _date = date;
            _rating = rating;
            this._task = task;
        }

        public static Achivement CreatePracticalTask(DateTime date, int ratingForQuality, int ratingForDate, PracticalTask task)
        {
            return new Achivement(date, ratingForDate+ratingForQuality,task);
        }
        public static Achivement CreateBoundaryControl(DateTime date, int rating, BoundaryControl control)
        {
            return new Achivement(date, rating, control);
        }
       public static Achivement CreateFinalControl(DateTime date, int rating, FinalControl control)
       {
           return new Achivement(date, rating, control);
       }

        public int Rating
        {
            get { return _rating; }
        }

        public Task Task
        {
            get { return _task; }
        }

        public bool isPass()
        {
            return _task.isPassed(_rating);
        }


        //потом удалить(печатает задание в консоль)
        public void print()
        {
            Console.WriteLine("Баллов - {0};", _rating);
            Console.WriteLine("Дата - {0};", _date);
            _task.print();
        }
    }
}
